package com.whiteape.book.model.bo;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.whiteape.book.model.dto.SiteSourceBean;
import com.whiteape.book.model.dto.SiteSourceCategoryBean;
import com.whiteape.book.model.type.HomePageLayoutType;
import com.whiteape.book.utils.HomepageLayoutTypeConverter;
import com.whiteape.book.utils.MapConverter;

import org.greenrobot.greendao.annotation.Convert;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Index;
import org.greenrobot.greendao.annotation.Transient;

import java.util.HashMap;

@Entity
public class CategoryDetailBo implements MultiItemEntity {
    @Override
    public int getItemType() {
        return homePageShowType.ordinal();
    }

    //书籍详情页url
    @Id
    private String detailUrl;

    //分类内容的下一页(每个bean中都带着)
    private String nextPage;

    @Convert(columnType = String.class, converter = MapConverter.class)
    private HashMap<String, String> varMap;

    @Index
    private String categoryUrl;

    @Transient
    private SiteSourceBean siteSourceBean;
    //分类bean
    @Transient
    private SiteSourceCategoryBean categoryBean;

    @Convert(converter = HomepageLayoutTypeConverter.class, columnType = String.class)
    private HomePageLayoutType homePageShowType;

    protected Integer mediaType;
    protected String title;
    protected String author;
    protected String coverUrl;
    protected String desc;
    protected String wordCount;
    protected String state;
    protected String category;
    protected String lastChapter;
    protected String lastUpdated;


    @Generated(hash = 668568038)
    public CategoryDetailBo(String detailUrl, String nextPage, HashMap<String, String> varMap,
            String categoryUrl, HomePageLayoutType homePageShowType, Integer mediaType,
            String title, String author, String coverUrl, String desc, String wordCount,
            String state, String category, String lastChapter, String lastUpdated) {
        this.detailUrl = detailUrl;
        this.nextPage = nextPage;
        this.varMap = varMap;
        this.categoryUrl = categoryUrl;
        this.homePageShowType = homePageShowType;
        this.mediaType = mediaType;
        this.title = title;
        this.author = author;
        this.coverUrl = coverUrl;
        this.desc = desc;
        this.wordCount = wordCount;
        this.state = state;
        this.category = category;
        this.lastChapter = lastChapter;
        this.lastUpdated = lastUpdated;
    }

    @Generated(hash = 541305220)
    public CategoryDetailBo() {
    }

    public HomePageLayoutType getHomePageShowType() {
        return homePageShowType;
    }

    public void setHomePageShowType(HomePageLayoutType homePageShowType) {
        this.homePageShowType = homePageShowType;
    }

    public String getCategoryUrl() {
        return categoryUrl;
    }

    public void setCategoryUrl(String categoryUrl) {
        this.categoryUrl = categoryUrl;
    }

    public SiteSourceCategoryBean getCategoryBean() {
        return categoryBean;
    }

    public void setCategoryBean(SiteSourceCategoryBean categoryBean) {
        this.categoryBean = categoryBean;
    }
    public String getDetailUrl() {
        return detailUrl;
    }

    public void setDetailUrl(String detailUrl) {
        this.detailUrl = detailUrl;
    }

    public String getNextPage() {
        return nextPage;
    }

    public void setNextPage(String nextPage) {
        this.nextPage = nextPage;
    }

    public HashMap<String, String> getVarMap() {
        return varMap;
    }

    public void setVarMap(HashMap<String, String> varMap) {
        this.varMap = varMap;
    }

    public SiteSourceBean getSiteSourceBean() {
        return siteSourceBean;
    }

    public void setSiteSourceBean(SiteSourceBean siteSourceBean) {
        this.siteSourceBean = siteSourceBean;
    }

    public Integer getMediaType() {
        return mediaType;
    }

    public void setMediaType(Integer mediaType) {
        this.mediaType = mediaType;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getCoverUrl() {
        return coverUrl;
    }

    public void setCoverUrl(String coverUrl) {
        this.coverUrl = coverUrl;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getWordCount() {
        return wordCount;
    }

    public void setWordCount(String wordCount) {
        this.wordCount = wordCount;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getLastChapter() {
        return lastChapter;
    }

    public void setLastChapter(String lastChapter) {
        this.lastChapter = lastChapter;
    }

    public String getLastUpdated() {
        return lastUpdated;
    }

    public void setLastUpdated(String lastUpdated) {
        this.lastUpdated = lastUpdated;
    }

    @Override
    public String toString() {
        return "CategoryDetailBo{" +
                ", detailUrl='" + detailUrl + '\'' +
                ", nextPage='" + nextPage + '\'' +
                ", siteSourceBean=" + siteSourceBean +
                ", varMap=" + varMap +
                ", mediaType=" + mediaType +
                ", title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", coverUrl='" + coverUrl + '\'' +
                ", desc='" + desc + '\'' +
                ", wordCount='" + wordCount + '\'' +
                ", state='" + state + '\'' +
                ", category='" + category + '\'' +
                ", lastChapter='" + lastChapter + '\'' +
                ", lastUpdated='" + lastUpdated + '\'' +
                '}';
    }
}
